﻿using Architecture.Repository.Interface;
using Architeture.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Architecture.Domain.Service
{
    public class CountyService : ICountyService
    {
        protected readonly ICountyRepository countyRep;

        public CountyService(ICountyRepository countyRep)
        {
            this.countyRep = countyRep;
        }

        public async Task<List<CountyInfo>> GetCounty(int cid)
        {
            return (await countyRep.GetAllAsync()).Where(x => x.CityInfoId == cid).ToList();
        }
    }
}
